<template>
  <el-table-column :render-header="render" :width="data.attribute.width" :resizable="data.resizable" :header-align="data.attribute['header-align']" :align="data.attribute.align" :fixed="data.attribute.fixed">
    <div slot-scope="scope" v-icanva>
      表体
      <component :is="item.components" v-model="value.slot[index]" v-for="(item,index) in value.slot" :key="index">{{scope.row}}</component>
    </div>
  </el-table-column>
</template>
<script type="text/javascript">
export default {
  props: {
    value: {
      type: [Array, Object],
      default: function() {
        return {
          type: 'primary',
          size: 'medium',
          name: '按钮'
        }
      }
    },
  },
  computed: {
    data() {
      return this.value.data
    }
  },
  mounted() {
    console.log('列', this.total);
  },
  /**
   * 页面方法
   * @type {Object}
   */
  methods: {
    render(h, { column, $index }) {
      return h('div', {
        attrs: {
          // class: 'cell',
        },
        directives: [{
          name: 'iedit',
          value: this.value,
        }],
        domProps: {
          innerHTML: this.data.attribute.label
        }
      })
    },
  }
}

</script>
<style type="text/css" lang="scss">
.addColumn {
  width: 100%;
  height: 50px;
  background-color: #ccc;
  overflow: auto;
  position: relative;
  z-index: 100860;
}

</style>
